import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:website.core/core/presentation/theme/theme.dart';

class HeaderLogoButton extends StatelessWidget {
  const HeaderLogoButton({
    required this.width,
    required this.onPressed,
    Key? key,
  }) : super(key: key);

  final double width;
  final VoidCallback onPressed;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onPressed,
      child: MouseRegion(
        cursor: SystemMouseCursors.click,
        child: SizedBox(
          width: width,
          child: Padding(
            padding: const EdgeInsets.symmetric(
              vertical: 12,
              horizontal: 16,
            ),
            child: AutoSizeText.rich(
              TextSpan(
                children: [
                  TextSpan(
                    text: 'angry ',
                    style: CoreTheme.of(context).textTheme.headerLogoButtonTitle.copyWith(
                          color: CoreTheme.of(context).primaryColor,
                        ),
                  ),
                  TextSpan(
                    text: 'words',
                    style: CoreTheme.of(context).textTheme.headerLogoButtonTitle,
                  ),
                ],
              ),
              stepGranularity: 0.1,
              maxLines: 1,
              softWrap: false,
            ),
          ),
        ),
      ),
    );
  }
}
